package com.tools.common.enums;

import lombok.Getter;

@Getter
public enum FlowStatusEnum {
    DRAFT("DRAFT", "草稿"),
    RUNNING("RUNNING", "运行中"),
    COMPLETED("COMPLETED", "已完成"),
    SUSPENDED("SUSPENDED", "已暂停"),
    CANCELLED("CANCELLED", "已取消");

    private final String code;
    private final String desc;

    FlowStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static FlowStatusEnum getByCode(String code) {
        for (FlowStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }
}